import { IsNumber, IsNumberString } from "class-validator";

export class BaseResponse {
  public success!: boolean;
  public message!: string;
}

export class BaseDto {
  public id!: number;
  public createTime!: string;
  public updateTime!: string;
}

export class BaseSingleResponseDto<T> extends BaseResponse {
  public data!: T;
}

export class BaseListResponseDto<T> extends BaseResponse {
  public data!: T[];
}

export class BasePageResponseDto<T> extends BaseListResponseDto<T> {
  public total!: number;
  public pageIndex!: number;
  public pageSize!: number;
}

export class BasePageRequestDto {
  @IsNumber()
  public pageIndex!: number;
  @IsNumber()
  public pageSize!: number;
}
